#include "Bonhomme.h"
#include "Boite.h"
#include "Sphere.h"
#include <vector>


using namespace std;

Bonhomme::Bonhomme(float x, float y, float z)
{

	setBoiteEnglobante(new Boite(x-1.2f, x+2.7f, y-.2f, y+1.2f, z-1.2f, z+.2f) );
	Sphere* tete = new Sphere(Point(x+2,y+.5f,z -.5f), 0.5f);
	Boite* corps = new Boite(x, x+1.5f, y, y+1, z-1, z);
	Boite* jambe1 = new Boite(x-1, x, y, y+0.3f,  z-1, z);
	Boite* jambe2 = new Boite(x-1, x, y+0.7f, y+1,  z-1, z);
	
	objets.push_back(tete);
	objets.push_back(corps);
	objets.push_back(jambe1);
	objets.push_back(jambe2);

}


void Bonhomme::setCouleur(Couleur c)
{
	for(vector<Objet*>::iterator it = objets.begin(); it!= objets.end(); it++)
	{
		(*it)->setCouleur(c);
	}
}